package com.itly.rwyxm.controller;

import com.itly.rwyxm.pojo.Code;
import com.itly.rwyxm.pojo.ParamData;
import com.itly.rwyxm.pojo.Result;
import com.itly.rwyxm.service.VisualizationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author:
 * @Version: 1.0
 * @Date: 2024-03-14-18:35
 * @Description:
 */
@Controller
@RequestMapping("/vis")
public class VisualizationController {

    @Autowired
    public VisualizationService service;

    @GetMapping("/data1")
    @ResponseBody
    public Result getData1() {
        List<ParamData> data = service.getData1();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data2")
    @ResponseBody
    public Result getData2() {
        List<ParamData> data = service.getData2();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data3")
    @ResponseBody
    public Result getData3() {
        List<ParamData> data = service.getData3();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data4")
    @ResponseBody
    public Result getData4() {
        List<ParamData> data = service.getData4();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data5")
    @ResponseBody
    public Result getData5() {
        List<ParamData> data = service.getData5();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data6")
    @ResponseBody
    public Result getData6() {
        List<ParamData> data = service.getData6();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data7")
    @ResponseBody
    public Result getData7() {
        List<ParamData> data = service.getData7();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data8")
    @ResponseBody
    public Result getData8() {
        List<ParamData> data = service.getData8();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data9")
    @ResponseBody
    public Result getData9() {
        List<ParamData> data = service.getData9();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

}
